﻿using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SCM.API.Write.Application.Command.Check;
using SCM.ErrorCode;

namespace SCM.API.Write.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class CheckController : ControllerBase
    {
        IMediator mediator;

        public CheckController(IMediator mediator)
        {
            this.mediator = mediator;
        }
        [HttpPost]
        public async Task<APIResult<int>> AddCheck(AddCheckCommand request)
        {
            return await mediator.Send(request);
        }
        [HttpPost]
        public async Task<APIResult<int>> AddProfitLoss(AddProfitLossCommand request)
        {
            return await mediator.Send(request);
        }
    }
}
